home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softwarová Záchrana 3
/
Softwarova-zachrana-3.bin
/
TextHarvest
/
TextHarvest-Install.exe
/
{app}
/
ScriptSample04.txt
< prev
next >
Wrap
Text File
|
2005-02-22
|
3KB
|
69 lines
;===============================================================================
; Sample Script for Pinnacle Software's TextHarvest Product
;===============================================================================
;
; This script was designed for the ToDoListFixed.dat sample input file,
; which is included with Pinnacle Software's script-enabled product
; TextHarvest (free download at www.parse-o-matic.com). The file is a
; fixed-record-length file with a record length of 80.
;
; This script converts the file (which apart from its data format is
; identical to the sample file ThingsToDo.txt) to CSV (Comma Separated
; Value) format. The CSV file will contain the two fields from the input
; file, along with a record counter.
;
;===============================================================================
; Config section
;==============================================================================
Config
;-----------------------------------------------------------------------------
; Files
;-----------------------------------------------------------------------------
$CfgDefaultIFN = 'ToDoListFixed.dat'
$CfgDefaultOFN = 'Temp.csv'
$CfgInpFileType = 'Binary'
$CfgRecLen = 80
$CfgOutFileType = 'Text'
;-----------------------------------------------------------------------------
; Documentation
;-----------------------------------------------------------------------------
$CfgCopyright = 'Copyright ⌐ 2005 by Pinnacle Software'
$CfgVersion = '1.00.00'
$CfgProgrammer = 'Timothy Campbell'
$CfgEmail = 'info@parse-o-matic.com'
$CfgLicense = 'This script may be used, at no charge, with any ' >>
'script-enabled Parse-O-Matic application, subject to any additional ' >>
'licensing requirements of such application.'
End
;===============================================================================
; Check settings
;===============================================================================
TaskInit
Begin $ActualIFN ~ $CfgDefaultIFN
Stop 'Please try this script with the' $0A$0D >>
'input file' $CfgDefaultIFN
End
RecNum = 0
End
;===============================================================================
; Get the category, remove extra spaces, and change case
;===============================================================================
Category = $OutData[1 9] ; Get columns 1 to 9
TrimChar Category ; Remove spaces on either side
Category = ChangeCase Category 'Hardcaps' ; Capitalize The Text
;===============================================================================
; Get the description and remove the trailing spaces.
;===============================================================================
Description = $OutData[10 80]
TrimChar Description 'R '
;===============================================================================
; Send CSV data to the output file
;===============================================================================
Inc RecNum
PadRecNum = Padded RecNum 3 'Left' '0'
OutCSV '' 'Init'
OutCSV PadRecNum 'Unquoted'
OutCSV Category
OutCSV Description
OutCSV '' 'Done'